//
//  CYCompanyInfo.m
//  CreditAddressBook
//
//  Created by Lee on 15/5/7.
//  Copyright (c) 2015年 Lee. All rights reserved.
//

#import "CYCompanyInfo.h"
#import "MJExtension.h"

@implementation CYCompanyInfo

+ (NSDictionary *)replacedKeyFromPropertyName {
    return @{@"companyId": @"id"};
}

/**
 *  从文件中解析对象的时候调
 */
- (id)initWithCoder:(NSCoder *)decoder
{
    if (self = [super init]) {
        self.companyId = [decoder decodeObjectForKey:@"companyId"];
        self.companyName = [decoder decodeObjectForKey:@"companyName"];
        self.companyAddress = [decoder decodeObjectForKey:@"companyAddress"];
        self.companyTel = [decoder decodeObjectForKey:@"companyTel"];
        self.companyFax = [decoder decodeObjectForKey:@"companyFax"];
        self.legalPerson = [decoder decodeObjectForKey:@"legalPerson"];
        self.legalLicenseNo = [decoder decodeObjectForKey:@"legalLicenseNo"];
        self.licenseNo = [decoder decodeObjectForKey:@"licenseNo"];
        self.legalLicenseZAddress = [decoder decodeObjectForKey:@"legalLicenseZAddress"];
        self.legalLicenseFAddress = [decoder decodeObjectForKey:@"legalLicenseFAddress"];
        self.status = [decoder decodeObjectForKey:@"status"];
        self.isSubmit = [decoder decodeObjectForKey:@"isSubmit"];
        self.licenseAddress = [decoder decodeObjectForKey:@"licenseAddress"];
    }
    return self;
}

/**
 *  将对象写入文件的时候调用
 */
- (void)encodeWithCoder:(NSCoder *)encoder
{
    [encoder encodeObject:self.companyId forKey:@"companyId"];
    [encoder encodeObject:self.companyName forKey:@"companyName"];
    [encoder encodeObject:self.companyAddress forKey:@"companyAddress"];
    [encoder encodeObject:self.companyTel forKey:@"companyTel"];
    [encoder encodeObject:self.companyFax forKey:@"companyFax"];
    [encoder encodeObject:self.legalPerson forKey:@"legalPerson"];
    [encoder encodeObject:self.legalLicenseNo forKey:@"legalLicenseNo"];
    [encoder encodeObject:self.licenseNo forKey:@"licenseNo"];
    [encoder encodeObject:self.legalLicenseZAddress forKey:@"legalLicenseZAddress"];
    [encoder encodeObject:self.legalLicenseFAddress forKey:@"legalLicenseFAddress"];
    [encoder encodeObject:self.status forKey:@"status"];
    [encoder encodeObject:self.isSubmit forKey:@"isSubmit"];
    [encoder encodeObject:self.licenseAddress forKey:@"licenseAddress"];
}
@end
